<template>
  <el-button
    type="default"
    size="default"
    color="#20B2AA"
    @click="click"
    v-hasPermi="perm"
    v-hasRole="role"
    v-hasRoleType="roleType"
  >
    <el-icon class="text-search">
      <Search />
    </el-icon>
    <span class="text-search">{{ text }}</span>
  </el-button>
</template>

<script>
export default {
  name: 'SearchButton',
  inheritAttrs: false,
  props: {
    text: {
      type: String,
      required: false,
      default: () => '查询'
    },
    perm: {
      type: Array,
      required: false,
      default: () => []
    },
    role: {
      type: Array,
      required: false,
      default: () => []
    },
    roleType: {
      type: Array,
      required: false,
      default: () => []
    }
  },
  methods: {
    click() {
      this.$emit('click')
    }
  }
}
</script>

<style lang="scss" scoped>
.text-search {
  color: #fff;
}
</style>
